<template>
  <div>
    <div class="container">
      <div class="left-menu">
        <div class="menu-item" v-for="(item, index) in list" :key="'sidebar'+index">
          <span>{{item.title}}</span>
          <i class="el-icon-arrow-right"></i>
          <div class="content">
            <ul class="wrap">
              <li class="item" v-for="(in_item, index) in item.product" :key="'inner'+index">
                <img v-lazy="in_item.img" alt="">
                <a class="title">{{in_item.name}}</a>
              </li>
            </ul>
          </div>
        </div>
      </div>
      <slider-swiper></slider-swiper>
    </div>
  </div>
</template>

<script>
import SliderSwiper from "./slider-swiper";

export default {
  name: 'left-menu',
  components: {SliderSwiper},
  data () {
    return {
      list: [
        {
          id: 1,
          title: '手机 电话卡',
          product: [
            {
              id: 1001,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        },
        {
          id: 2,
          title: '电视 盒子',
          product: [
            {
              id: 1001,
              img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/37576cef378ef2805c20b9ab2a9d6d3d.png?thumb=1&w=40&h=40&f=webp&q=90',
              name: '小米透明电视'
            },
            {
              id: 1002,
              img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/7da49e7ada2229c963c9c7353a58d49b.png?thumb=1&w=40&h=40&f=webp&q=90',
              name: '小米电视 大师 65英寸OLED'
            },
            {
              id: 1003,
              img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/070b329c18c1ab167df2a42564a67813.png?thumb=1&w=40&h=40&f=webp&q=90',
              name: 'Redmi 智能电视 X65'
            },
            {
              id: 1004,
              img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/070b329c18c1ab167df2a42564a67813.png?thumb=1&w=40&h=40&f=webp&q=90',
              name: 'Redmi 智能电视 X65'
            },
            {
              id: 1005,
              img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/d8264eb9b900ead63eea69f6fc1e413a.png?thumb=1&w=40&h=40&f=webp&q=90',
              name: '小米电视5 65英寸'
            }
          ]
        },
        {
          id: 3,
          title: '笔记本 显示器',
          product: [
            {
              id: 10011,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        },
        {
          id: 4,
          title: '笔记本 显示器',
          product: [
            {
              id: 10011,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        },
        {
          id: 5,
          title: '笔记本 显示器',
          product: [
            {
              id: 10011,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        },
        {
          id: 6,
          title: '笔记本 显示器',
          product: [
            {
              id: 10011,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        },
        {
          id: 7,
          title: '笔记本 显示器',
          product: [
            {
              id: 10011,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        },
        {
          id: 8,
          title: '笔记本 显示器',
          product: [
            {
              id: 10011,
              img: '/imgs/item-box-1.png',
              name: '小米9'
            }
          ]
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  width: 1226px;
  margin: 0 auto;
  display: flex;
  position: relative;
}

.left-menu {
  width: 264px;
  background: #93999c87;
  max-height: 450px;
  min-height: 450px;
  /*overflow: hidden;*/
  padding: 26px 0;
  box-sizing: border-box;
  z-index: 4;
  /*position: relative;*/

  .menu-item {
    width: 100%;
    height: 50px;
    background-color: transparent;
    color: #ffffff;
    font-size: 16px;
    line-height: 50px;

    span {
      font-family: FZLanTingHeiS-R-GB;
      font-weight: bold;
      margin-left: 30px;
      font-size: 16px;
    }

    i {
      float: right;
      margin-top: 19px;
      margin-right: 15px;
    }

    .content {
      width: 962px;
      height: 451px;
      padding: 14px 23px;
      background: #ffffff;
      box-shadow: 1px 7px 6px 0px rgba(0, 0, 0, 0.11);
      position: absolute;
      left: 264px;
      top: 0;
      z-index: 10;
      opacity: 0;
      transition: .3s linear;
      box-sizing: border-box;
      visibility: hidden;

      .wrap {
        display: flex;
        flex-wrap: wrap;

        .item {
          width: 25%;
          display: flex;
          align-items: center;
          padding: 14px 0;

          img {
            height: 42px;
          }

          .title {
            color: #343434;
            margin-left: 15px;
            font-size: 14px;
            width: 158px;
            height: 42px;
            line-height: 42px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: inline-block;
          }
        }
      }
    }

    &:hover {
      cursor: pointer;
      background: #ff6600;

      .content {
        opacity: 1;
        width: 962px;
        visibility: visible;
      }
    }
  }
}
</style>
